package com.mq.demo.utils;

/**
 * @Author Re
 * @create 2023/2/28 17:05
 * @Description 结果返回
 */
public class JsonResult {

    public static final int SUCCESS = 200;
    public static final int ERROR = 500;
    /**服务器相应状态*/
    private int state;
    /**信息(给用户的提示)*/
    private String message;
    /**具体业务数据*/
    private Object data;

    public JsonResult() {
        this.state = SUCCESS;
        this.message="ok";
    }
    public JsonResult(int state,String message) {
        this.state = state;
        this.message = message;
    }
    public JsonResult(Object data) {
        this();
        this.data = data;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
